import * as yaml from "yaml";
import * as fs from "fs";
import * as path from "path";

const yamlPath = path.resolve(__dirname, "../public/config/config.yaml");
const jsonPath = path.resolve(__dirname, "../public/config/config.json");
console.log("cfgFilePath: " + yamlPath);

const configRaw = fs.readFileSync(yamlPath);
console.log("configRaw: " + configRaw);
const config = yaml.parse(configRaw.toString());

fs.writeFileSync(jsonPath, JSON.stringify(config, null, 2));
